<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台基本设置</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Public/Admin/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css" rel="stylesheet">
    <link href="/Public/Admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/switchery/switchery.css" rel="stylesheet">
</head>
<body calss="gray-by">
<style>
    #img1{
        height: 35px;
        width: 200px;
        background-color: #CCCCCC;

    }
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>网站信息</h5>
                    <div class="ibox-tools">
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <ul id="myTab" class="nav nav-tabs nav-justified">
                            <li class="active"><a href="#home" data-toggle="tab">站点设置</a>
                            </li>
                            <li><a href="#core" data-toggle="tab">核心配置</a></li>
                            <li><a href="#email" data-toggle="tab">邮箱配置</a></li>
                            <li><a href="#adjunct" data-toggle="tab">附件配置</a></li>
                            <li><a href="#member" data-toggle="tab">会员整合</a></li>
                        </ul>
                    </div>
                    <form action="<?php echo U('Admin/Config/addSave');?>" name="forma" id="forma" method="post" enctype="multipart/form-data">
                        <div id="myTabContent" class="tab-content">
                            <div class="tab-pane fade in active" id="home">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数描述</th>
                                        <th>变量值</th>
                                        <th>变量名</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <?php if(is_array($list)): foreach($list as $key=>$vo): if($vo['group_id'] == 0): ?><tr>
                                                <td><?php echo ($vo["title"]); ?></td>
                                                <td>
                                                    <input type="text" class="form-control" name="<?php echo ($vo["variable"]); ?>" value="<?php echo ($vo["value"]); ?>">
                                                </td>
                                                <td> <input type="text" class="form-control"  value="<?php echo ($vo["variable"]); ?>" readonly></td>
                                            </tr><?php endif; endforeach; endif; ?>

                                    </tbody>
                                </table>
                            </div>
                            <div class="tab-pane fade" id="core">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数描述</th>
                                        <th>变量值</th>
                                        <th>变量名</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <?php if(is_array($list)): foreach($list as $key=>$vo): if($vo['group_id'] == 1): ?><tr>
                                                <td><?php echo ($vo["title"]); ?></td>
                                                <td>
                                                    <input type="text" class="form-control" name="<?php echo ($vo["variable"]); ?>" value="<?php echo ($vo["value"]); ?>">
                                                </td>
                                                <td> <input type="text" class="form-control"  value="<?php echo ($vo["variable"]); ?>" readonly></td>
                                            </tr><?php endif; endforeach; endif; ?>

                                    </tbody>

                                </table>
                            </div>
                            <div class="tab-pane fade" id="email">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数描述</th>
                                        <th>变量值</th>
                                        <th>变量名</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <?php if(is_array($list)): foreach($list as $key=>$vo): if($vo['group_id'] == 2): ?><tr>
                                                <td><?php echo ($vo["title"]); ?></td>
                                                <td>
                                                    <input type="text" class="form-control" name="<?php echo ($vo["variable"]); ?>" value="<?php echo ($vo["value"]); ?>">
                                                </td>
                                                <td> <input type="text" class="form-control"  value="<?php echo ($vo["variable"]); ?>" readonly></td>
                                            </tr><?php endif; endforeach; endif; ?>

                                    </tbody>
                                </table>
                            </div>
                            <div class="tab-pane fade" id="adjunct">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数描述</th>
                                        <th>变量值</th>
                                        <th>变量名</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php if(is_array($list)): foreach($list as $key=>$vo): if($vo['group_id'] == 3): ?><tr>
                                                <td><?php echo ($vo["title"]); ?></td>
                                                <td>
                                                    <input type="text" class="form-control" name="<?php echo ($vo["variable"]); ?>" value="<?php echo ($vo["value"]); ?>">
                                                </td>
                                                <td> <input type="text" class="form-control"  value="<?php echo ($vo["variable"]); ?>" readonly></td>
                                            </tr><?php endif; endforeach; endif; ?>
                                    <!--<tr>-->
                                        <!--<td>LOGO：</td>-->
                                        <!--<td>-->
                                            <!--<input type="file" class="form-control" name="img" value="" style="width:25%; float:left;" data-toggle="hover" data-place="right" data-image="<?php echo ($list["img"]); ?>">&nbsp;&nbsp;&nbsp;&nbsp;-->
                                            <!--<input type="text" readonly class="button bg-blue margin-left" id="img1" name="img1" value="<?php echo ($list["img"]); ?>" >-->
                                        <!--</td>-->
                                        <!--&lt;!&ndash;<td> <input type="text" class="form-control"  value="<?php echo ($list1["img"]); ?>" readonly></td>&ndash;&gt;-->
                                    <!--</tr>-->
                                    </tbody>
                                </table>
                            </div>
                            <div class="tab-pane fade" id="member">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数描述</th>
                                        <th>变量值</th>
                                        <th>变量名</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <?php if(is_array($list)): foreach($list as $key=>$vo): if($vo['group_id'] == 4): ?><tr>
                                                <td><?php echo ($vo["title"]); ?></td>
                                                <td>
                                                    <input type="text" class="form-control" name="<?php echo ($vo["variable"]); ?>" value="<?php echo ($vo["value"]); ?>">
                                                </td>
                                                <td> <input type="text" class="form-control"  value="<?php echo ($vo["variable"]); ?>" readonly></td>
                                            </tr><?php endif; endforeach; endif; ?>
                                    </tbody>

                                </table>
                            </div>
                        </div>
                        <td style="text-align: center" colspan="5">
                            <button class="btn btn-primary" type="submit" id="submit">保存内容</button>
                            <button class="btn btn-white" type="reset"  onclick="history.go(-1)">重置</button>
                        </td>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/Admin/js/jquery.min.js"></script>
<script src="/Public/Admin/js/bootstrap.min.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Public/Admin/js/plugins/switchery/switchery.js"></script>
<script src="/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/Public/Admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/Public/Admin/js/common.js"></script>
<script>
    $(function(){
        $('#submit').click(function(){
            var data = new FormData(document.getElementById('forma'));
            $.ajax({
                url:$('#forma').attr('action'),
                type:"POST",
                data:data,
                cache:false,  //不开启缓存
                processData:false, //不格式化数据
                contentType:false, //并没有很在意,只是知晓它是代表发送信息至服务器时内容编码类型,通俗点说就是告诉服务器从浏览器提交
                success:function(data){
                    if(data.status > 0){
                        common.error(data.msg);
                    }else{
                        common.success(data.msg,"<?php echo U('Admin/Config/index');?>");
                    }
                },
                dataType:"JSON"
            });
            return false;
        });
    });
</script>
</body>
</html>